package org.easybuy.lintenter;

import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import org.easybuy.entity.CommodityCategory;
import org.easybuy.service.CommodityCategoryService;
import org.easybuy.serviceimpol.CommdoityCategoryServiceImopl;

public class CommodityCategoryServletContext implements ServletContextListener {

	@Override
	public void contextDestroyed(ServletContextEvent arg0) {
		// 暂无需求

	}

	@Override
	public void contextInitialized(ServletContextEvent arg0) {
		ServletContext appliction = arg0.getServletContext();
		CommodityCategoryService commodityCategoryService = new CommdoityCategoryServiceImopl();
		List<CommodityCategory> list = new ArrayList<CommodityCategory>();
		list = commodityCategoryService.getAllFirstcCategories();
		appliction.setAttribute("SHOW_ALL_CATE", list);

	}

}
